package com.flbill.controller;

import com.flbill.common.result.Result;
import com.flbill.pojo.vo.ClassVO;
import com.flbill.service.ClassService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("api/class")
public class ClassController {
    private final ClassService classService;

    public ClassController(ClassService classService) {
        this.classService = classService;
    }

//    @PostMapping("add")
//    public Result addClass(@RequestBody ClassDTO classDTO) {
//        classService.addClass(classDTO);
//        return Result.success();
//    }

    @GetMapping("list")
    public Result<List<ClassVO>> list(@RequestParam String type) {
        List<ClassVO> list = classService.list(type);
        return Result.success(list);
   }
}
